package org.sixtythousand.joker.netty;

import io.netty.channel.ChannelHandlerContext;
import org.sixtythousand.joker.handler.HandlerManager;
import org.sixtythousand.joker.http.HttpChannel;

/**
 * @author zhoulk
 * @date 2023/10/11 15:35
 * @desc
 */
public class NettyHttpChannel extends HttpChannel {
    private final ChannelHandlerContext ctx;
    public NettyHttpChannel(ChannelHandlerContext ctx ) {
        this.ctx = ctx;
      }


    @Override
    public Runnable onRead(Object data) {
        return ctx::read;
    }

    @Override
    public void writeAndFlush(Object data) {
        ctx.writeAndFlush(data);
    }


    public ChannelHandlerContext getCtx() {
        return ctx;
    }





 }
